$TITLE ('RTX-51/BCAN HW-DEFINITIONS')
$NOXREF
$NOSYMBOLS
$NORB
$DEBUG
$PAGELENGTH(80) PAGEWIDTH(110)
;************************************************************************
;************************************************************************
;*                                                                      *
;*  HW-DEFINITIONS FOR RTX-51 / BASIC-CAN DRIVER                        *
;*                                                                      *
;************************************************************************
;************************************************************************
;*                                                                      *
;*  PURPOSE:        User confuguration of HW-Adresses, Buffer           *
;*                  allocation, timeouts and interrupts for the         *
;*                  RTX-51/BCAN-Driver                                  *
;*                  This source file is part of the RTX-51/CAN          *
;*                  object code disk.                                   *
;*                                                                      *
;*  FILENAME:       BCANCONF.A51                                        *
;*                                                                      *
;*  MODULENAME:     --                                                  *
;*                                                                      *
;*  TARGETSYSTEM:   Any system based upon 8051 up with Philips 82C200   *
;*                  CAN-Controller.                                     *
;*                                                                      *
;*  LANGUAGE:       Keil ASM-51                                         *
;*                                                                      *
;************************************************************************
;*  REVISION HISTORY :                                                  *
;*                                                                      *
;*  - 22. OKT 1990; Th. Fischler; Rev 0.1 :                             *
;*       First Version                                                  *
;*  - 27. MAY 1991; Th. Fischler; Rev 0.2 :                             *
;*       MAX_NBR_OF_SEND_TRIALS added                                   *
;*  - 13. AUG 1991; Th. Fischler; Rev 0.3 :                             *
;*       New unit for MAX_NBR_OF_SEND_TRIALS                            *
;*  - 11. OCT 1991; Th. Fischler; Rev 1.0                               *
;*       Adapted for RTX-51 V4.0                                        *
;*                                                                      *
;************************************************************************
;*    Copyright 1991 .. 2001 METTLER  &  FUCHS  AG,  CH-8953 Dietikon   *
;************************************************************************


PUBLIC  BCAN_REG
PUBLIC  CAN_OBJ_BUF, CAN_OBJ_BUF_START, CAN_OBJ_BUF_END
PUBLIC  CAN_INT_NBR
PUBLIC  NBR_OF_SEND_TRIALS


;************************************************************************
;*                                                                      *
;*   THE FOLLOWING VALUES CAN BE ALTERED BY THE USER                    *
;*                                                                      *
;************************************************************************


; 14 bytes from the object-buffer are reserved for internal use
; each defined object needs 14 bytes from the object buffer
; so with an object-buffer length of 28 bytes you can define 1 object
; and with an object-buffer length of 42 byte you can define 2 objects
;
; object_buffer_lengt = (max-number-of-objects * 14) + 14
;

OBJ_BUFFER_LENGTH       EQU 500         ; Number of bytes for the
                                        ; object-buffer

CONTROLLER_BASE         EQU 0F000H      ; XDATA start-address of the
                                        ; CAN-Controller

; The following constant defines the interrupt-number (as defined by
; RTX-51 V4.0) for the CAN-Controller

USED_CAN_INT_NBR        EQU 0

; The next constant defines the number of send-trials for the first
; communication object after startup in number of system-clocks.
; (0 to 255 / Default 10)

MAX_NBR_OF_SEND_TRIALS  EQU 10


;************************************************************************
;*                                                                      *
;*   DO NOT ALTER THE FOLLOWING DECLARATIONS !!!                        *
;*                                                                      *
;************************************************************************

; Object-Buffer declaration

CAN_OBJ_BUF_SEG         SEGMENT         XDATA
                        RSEG            CAN_OBJ_BUF_SEG
CAN_OBJ_BUF_START:
CAN_OBJ_BUF:            DS OBJ_BUFFER_LENGTH      ; Object-Buffer Length
CAN_OBJ_BUF_END:


; CAN-Controller declarations

                        XSEG AT CONTROLLER_BASE
BCAN_REG:               DS 32                     ; Number of bytes for the
                                                  ; Philips 82C200 Controller

; Constant declaration
?CO?CAN_CONST_SEG          SEGMENT         CODE
                           RSEG            ?CO?CAN_CONST_SEG
NBR_OF_SEND_TRIALS:        DB MAX_NBR_OF_SEND_TRIALS
CAN_INT_NBR:               DB USED_CAN_INT_NBR

;
;   END OF MODULE
    END
